#include <stdio.h>
int main() {
    int n, temp = 1;
    double sum = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        temp *= i;
        sum += temp;        
    }
    printf("%.0lf", sum);
    return 0;
}